#include <stdio.h>
#include <stdlib.h>
#include <memory.h>

int main (int argc, char const* argv[])
{
    int n, i, ans, list[201], target;

    memset(list, 0, sizeof(list));

    scanf("%d", &n);
    i = n;
    while (--i) {
        do {
            scanf("%d", &target);
            list[target] = 1;
        } while (target);
    }

    ans = 0;
    for (i = 1; i < n; i++) {
        printf("%d\n", list[i]);
        if (list[i] == 0) ans++;
    }

    printf("\n\n%d\n", ans);

    return 0;
}
